package com.huawei.appmarket.service.store.awk.node;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import com.huawei.appgallery.foundation.ui.framework.widget.Space;
import com.huawei.appmarket.service.store.awk.card.NewEntranceCard;
import java.util.ArrayList;
import o.azb;
import o.cdr;
import o.chz;
import o.cih;
import o.ebk;
import o.eib;
import o.ewm.h;
import o.ewm.j;

public class NewEntraceNode extends cdr {
    private static final LayoutParams ˊ = new LayoutParams(eib.ʼॱ(), -1);
    private ebk ʻ;
    private View ॱॱ;

    public NewEntraceNode(Context context) {
        super(context, eib.ॱˋ());
    }

    public int ˏ() {
        return eib.ॱˋ();
    }

    public boolean ˊ(ViewGroup viewGroup, ViewGroup viewGroup2) {
        LayoutInflater from = LayoutInflater.from(this.ॱ);
        View inflate = from.inflate(h.ॱᐧ, null);
        LinearLayout linearLayout = (LinearLayout) inflate.findViewById(j.ʾʻ);
        this.ॱॱ = inflate.findViewById(j.ॱㆍ);
        this.ʻ = new ebk();
        this.ʻ.ˎ(inflate);
        this.ʻ.ˊ(inflate);
        int ˏ = ˏ();
        for (int i = 0; i < ˏ; i++) {
            View ˏ2 = ˏ(from);
            ˋ(ˏ2, i);
            linearLayout.addView(ˏ2);
            if (i < ˏ - 1) {
                linearLayout.addView(new Space(this.ॱ), ˊ);
            }
        }
        linearLayout.setPadding(azb.ˊ(this.ॱ), 0, azb.ˏ(this.ॱ), 0);
        viewGroup.addView(inflate);
        return true;
    }

    public ArrayList<String> ˋॱ() {
        if (this.ʻ != null) {
            return this.ʻ.ˋ();
        }
        return null;
    }

    protected void ˋ(View view, int i) {
        cih newEntranceCard = new NewEntranceCard(this.ॱ);
        newEntranceCard.ˏ(view);
        ˊ(newEntranceCard);
        if (i == 0) {
            newEntranceCard.ˋ(this.ʻ);
        }
    }

    protected View ˏ(LayoutInflater layoutInflater) {
        return layoutInflater.inflate(h.ʼᐝ, null);
    }

    public boolean ॱ(chz o_chz, ViewGroup viewGroup) {
        if (this.ॱॱ != null) {
            if (o_chz.ॱ == 0) {
                this.ॱॱ.setVisibility(0);
            } else {
                this.ॱॱ.setVisibility(8);
            }
        }
        return super.ॱ(o_chz, viewGroup);
    }
}
